package cn.itcast.dao;

import cn.itcast.domain.Courier;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface CourierDao extends JpaRepository<Courier,Integer>,JpaSpecificationExecutor<Courier> {

    /**
     * 删除操作
     * @param id
     */
    @Modifying
    @Query(value = "update Courier set deltag= 1 where id=?1")
    public void delete(int id);


    /**
     * 还原操作
     * @param id
     */
    @Modifying
    @Query(value = "update Courier set deltag= null where id=?1")
    public void init(int id);


}
